home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12180 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: beta.nedernet.nl!usenet
  2. From: jos@and.nl (Jos A. Horsmeier)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: formatting integers
  5. Date: 29 Mar 1996 16:15:46 GMT
  6. Organization: AND Operations Research B.V.
  7. Distribution: usa
  8. Message-ID: <4jh2bi$2ll@beta.nedernet.nl>
  9. References: <4jfmsh$lal@uwm.edu>
  10. NNTP-Posting-Host: klepzeiker.and.nl
  11. Mime-Version: 1.0
  12. Content-Type: Text/Plain; charset=ISO-8859-1
  13. X-Newsreader: WinVN 0.99.5
  14.  
  15. In article <4jfmsh$lal@uwm.edu>, gidwani@alpha1.csd.uwm.edu wrote:
  16.  
  17. |I am trying to format an integer that is left justified, length of 4 and
  18. |0 filled.
  19. |
  20. |I tried the following %-0*%d and typed in the length of 4, but it gave me
  21. |the following output
  22. |
  23. |    4.
  24. |    When I try %0*d, then I get the following output.
  25. |    0004. 
  26. |    The length and the 0 filled in works but I cannot get it to left
  27. |    justify.
  28.  
  29. Correct me if I'm wrong, but doesn't 'left justifying' mean that the
  30. most significant digit of the number appears at the leftmost position,
  31. i.e. no other characters precede that most sifnificant digit?
  32.  
  33. kind regards,
  34.  
  35. Jos aka jos@and.nl
  36. -- 
  37. Atnwgqkrl gy zit vgksr, ug qshiqwtzoeqs!
  38.  
  39.